package bdqn.t09.controller;

import bdqn.t09.service.AsKeywordsService;
import bdqn.t09.util.Pageinfo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

@Controller
public class keywordsController {

    @Resource
    private AsKeywordsService keywordsService;

    @RequestMapping(value = "showPortal")
    @ResponseBody
    public Object doShowPortal(@RequestParam(defaultValue = "1")Integer page,
                                 @RequestParam(defaultValue = "10") Integer rows,
                                 String keywords,String customname){
        System.out.println("111:" + customname);
        Pageinfo pageinfo = keywordsService.selectAllPortal(page, rows, keywords, customname);

        Map map = new HashMap();
        map.put("rows",pageinfo.getList());
        map.put("total",pageinfo.getCount());
        return map;
    }

}
